<template>
	<view class="g-box">
		<view class="u-btn-box"  @click="login">
			<image class="u-btn-img  f-mr" src="../../static/icon/wx.png" mode=""></image>
			<view class="u-btn-txt">微信登录</view>
		</view>
	</view>
</template>

<script>
	import LOGIN from '@/api/login/login.js'

	export default {
		data() {
			return {
				user: {
					name: "admin",
					pwd: "12356"
				}
			}
		},
		mounted() {
		},
		methods: {
			login() {
				// uni.login({
				// 	provider: "weixin",
				// 	success(res) {
				// 		var code = res.code;
				// 		if (code) {
				// 			uni.getUserInfo({
				// 				success(res) {
				// 					console.log(code)
				// 					console.log(res.iv)
				// 					console.log(res.encryptedData)
				// 				}
				// 			})
				// 		}
				// 	},
				// 	fail() {
				// 		console.log(374)
				// 	}
				// })
				uni.setStorageSync("token", "121")
				uni.redirectTo({
					url: "../idChoose/index",
					success() {
						console.log(12, "跳转");
					},
					fail(res) {
						console.log(res)
					}
				})
				let userInfo = {
					name: "sun",
					avatat: "hjkh"
				}
				uni.setStorageSync("info", userInfo)
			}
		}
	}
</script>

<style scoped lang="scss">
	.g-box {
		display: flex;
		justify-content: center;
		align-items: center;
		box-sizing: border-box;
		width: 750rpx;
		height: 100vh;
	}
</style>
